//
//  main.c
//  求偶数因子
//
//  Created by apple on 2017/1/6.
//  Copyright © 2017年 apple. All rights reserved.
//

#include<stdio.h>
int main()
{
    int n,i,num,j,a[20],k=0,x;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&num);
        for(j=2;j<=num;j+=2)
        {
            if(num%j==0)
            {
                a[k]=j;
                k++;
            }
        }
        if(k==0)
            printf("%d has no even factors",num);
        else
            for(x=0;x<k;x++)
                printf("%d ",a[x]);
        printf("\n");
    }
}